import pytest
import os
import shutil



if __name__ == '__main__':

    # 清除数据
    report_dir = "./report/temp_report"
    if os.path.exists(report_dir):
        shutil.rmtree(report_dir)


    pytest.main(["./test", "-sv", "--alluredir", "./report/temp_report"])

    # 生成静态HTML报告
    os.system("allure generate ./report/temp_report -o ./report/html --clean")

    os.system("allure serve ./report/temp_report")









